﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Retete.Models;

namespace Retete.ViewModels
{
    public class VanzariViewModel
    {
        public List<Vanzare> Vanzari { get; set; }
        public int IDElementSters { get; set; }
        public DateTime SelectedDate { get; set; }

        public decimal Valoare
        {
            get
            {
                if (Vanzari != null) return Vanzari.Sum(element => element.Valoare);
                else return 0;
            }
        }
        public decimal ValoareCasa
        {
            get
            {
                if (Vanzari != null) return Vanzari.Where(element => element.Tip == "Plata numerar" || element.Tip == "Plata prin virament").Sum(element => element.Valoare);
                else return 0;
            }
        }
    }
}